import { rawRequestClient } from '#/api/request';

/**
 * 获取群组列表
 */
export function getGroupList(params?: any) {
  return rawRequestClient.get(`${import.meta.env.VITE_AUTH_SERVER}/groups`, { params });
}

/**
 * 获取群组详情
 */
export function getGroupDetail(id: number) {
  return rawRequestClient.get(`${import.meta.env.VITE_AUTH_SERVER}/groups/${id}`);
}

/**
 * 创建群组
 */
export function createGroup(data: any) {
  return rawRequestClient.post(`${import.meta.env.VITE_AUTH_SERVER}/groups`, data);
}

/**
 * 更新群组
 */
export function updateGroup(id: number, data: any) {
  return rawRequestClient.put(`${import.meta.env.VITE_AUTH_SERVER}/groups/${id}`, data);
}

/**
 * 删除群组
 */
export function deleteGroup(id: number) {
  return rawRequestClient.delete(`${import.meta.env.VITE_AUTH_SERVER}/groups/${id}`);
}
